'''
发送方，先发送再接收
'''
from socket import socket,AF_INET,SOCK_DGRAM
socket_ser = socket(AF_INET,SOCK_DGRAM)
ip_port = ('127.0.0.1',80)
data = input("输入要发送的数据")
socket_ser.sendto(data.encode('utf-8'),ip_port)

recv_data,recv_addr = socket_ser.recvfrom(1024)
print("接收到：",recv_data.decode('utf-8'))

socket_ser.close()